#include "coid/svc/coidsvc.h"

//{client 
#include "coid/comm/binstream/stlstream.h"
//}client

#include "string.h"
#include <stdlib.h>

//{client 
struct cFormula
{
	std::string aFormula;
	std::string aResult;
	
	friend binstream & operator << ( binstream & out, const cFormula & x ) 	
	{ 
		return out << x.aFormula << x.aResult; 
	};

	friend binstream & operator >> ( binstream & in, cFormula & x ) 
	{
		return in >> x.aFormula >> x.aResult;
    };

	friend metastream& operator << ( metastream& m, const cFormula & x )
    {
        MSTRUCT_OPEN(m,"Formula");
	MM(m,"formula",x.aFormula);
	MM(m,"result",x.aResult);
	MSTRUCT_CLOSE(m);
    }
};
//}client


class calculator
{

public:
	calculator();

	~calculator();

	net_fnc_s net_meta opcd accept_connect( );

	net_fnc net_meta opcd processFormula(net_in cFormula & formulaIn, net_out cFormula & formulaOut);

};